package org.locker.domain.bo;

import org.locker.domain.Device;
import org.locker.common.mybatis.core.domain.BaseEntity;
import org.locker.common.core.validate.*;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 设备信息业务对象 lk_device
 *
 * @author winnie
 * @date 2023-10-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = Device.class, reverseConvertGenerate = false)
public class DeviceBo extends BaseEntity {

    /**
     * 设备ID
     */
    @NotNull(message = "设备ID不能为空", groups = { EditGroup.class })
    private Long deviceId;

    /**
     * 设备编号
     */
    private String deviceNo;

    /**
     * 设备绑定密码
     */
    private String devicePwd;

    /**
     * 场地ID
     */
    @NotNull(message = "场地ID不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long positionId;

    /**
     * 设备名称
     */
    @NotBlank(message = "设备名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String name;

    /**
     * 设备描述
     */
    @NotBlank(message = "设备描述不能为空", groups = { AddGroup.class, EditGroup.class })
    private String describe;

    /**
     * 设备位置
     */
    @NotBlank(message = "设备位置不能为空", groups = { AddGroup.class, EditGroup.class })
    private String deviceLocation;

    /**
     * 设备状态：online 上线,offline 离线 , discard 废弃
     */
    @NotBlank(message = "设备状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private String status;

    /**
     * 渠道(升级系统用到)
     */
    private String channel;

    /**
     * 建立时间
     */
    private Date connectTime;

    /**
     * 掉线时间
     */
    private Date lossTime;

    /**
     * 格子总数量
     */
    private Long gardNum;

    /**
     * 进入设备后台账号
     */
    @NotBlank(message = "后台账号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String adminUser;

    /**
     * 进入设备后台的密码。
     */
    @NotBlank(message = "后台密码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String adminPwd;

    /**
     * 备注
     */
    private String remark;

    /**
     * Imli
     */
    private String deviceImei;

    /**
     * 设备卡号
     */
    private String deviceCardNo;

    /**
     * 设备通讯卡号ICCID
     */
    private String deviceIccid;

    /**
     * 设备类型： serial 串口锁，bluetooth 蓝牙锁
     */
    @NotBlank(message = "设备类型", groups = { AddGroup.class, EditGroup.class })
    private String deviceType;

    /**
     * 设备二维码
     */
    private String deviceQrCode;


    /**
     * 设备公众号二维码
     */
    private String deviceMpQrCode;


    private Integer isShowMp;
    /**
     * 押金金额
     */
    private BigDecimal depositAmount;

    /**
     * 收费类型：free 免费  hour 小时, times 按次，special 特殊方式
     */
    private String feeType;

    /**
     * 收费配置:{json}
     */
    private String feeConfig;
}
